<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Paho C++: mqtt::message Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Paho C++
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">The Paho MQTT C++ Client Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classmqtt_1_1message.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classmqtt_1_1message-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">mqtt::message Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>An MQTT message holds everything required for an MQTT PUBLISH message.  
 <a href="classmqtt_1_1message.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="message_8h_source.html">message.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:af207327d7802ed7133640d3c18921017"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> = std::shared_ptr&lt; <a class="el" href="classmqtt_1_1message.html">message</a> &gt;</td></tr>
<tr class="memdesc:af207327d7802ed7133640d3c18921017"><td class="mdescLeft">&#160;</td><td class="mdescRight">Smart/shared pointer to this class.  <a href="#af207327d7802ed7133640d3c18921017">More...</a><br/></td></tr>
<tr class="separator:af207327d7802ed7133640d3c18921017"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a99c3bfaaac300457e9678b5d1be30a43"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a99c3bfaaac300457e9678b5d1be30a43">const_ptr_t</a> = std::shared_ptr&lt; const <a class="el" href="classmqtt_1_1message.html">message</a> &gt;</td></tr>
<tr class="memdesc:a99c3bfaaac300457e9678b5d1be30a43"><td class="mdescLeft">&#160;</td><td class="mdescRight">Smart/shared pointer to this class.  <a href="#a99c3bfaaac300457e9678b5d1be30a43">More...</a><br/></td></tr>
<tr class="separator:a99c3bfaaac300457e9678b5d1be30a43"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3c82927ad233c393b30f28f376b9d1b0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3c82927ad233c393b30f28f376b9d1b0"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a3c82927ad233c393b30f28f376b9d1b0">message</a> ()</td></tr>
<tr class="memdesc:a3c82927ad233c393b30f28f376b9d1b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message with an empty payload, and all other values set to defaults. <br/></td></tr>
<tr class="separator:a3c82927ad233c393b30f28f376b9d1b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd8379776588fb77bbdc967c74e13cb3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#abd8379776588fb77bbdc967c74e13cb3">message</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>, const void *payload, size_t len, int qos, bool retained)</td></tr>
<tr class="memdesc:abd8379776588fb77bbdc967c74e13cb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message with the specified array as a payload, and all other values set to defaults.  <a href="#abd8379776588fb77bbdc967c74e13cb3">More...</a><br/></td></tr>
<tr class="separator:abd8379776588fb77bbdc967c74e13cb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2faf94bc3aaf3d8795d2be0933df7ce4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a2faf94bc3aaf3d8795d2be0933df7ce4">message</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>, const void *payload, size_t len)</td></tr>
<tr class="memdesc:a2faf94bc3aaf3d8795d2be0933df7ce4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message with the specified array as a payload, and all other values set to defaults.  <a href="#a2faf94bc3aaf3d8795d2be0933df7ce4">More...</a><br/></td></tr>
<tr class="separator:a2faf94bc3aaf3d8795d2be0933df7ce4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3dcd0a546f56884a5e552b5315437e46"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a3dcd0a546f56884a5e552b5315437e46">message</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>, <a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload, int qos, bool retained)</td></tr>
<tr class="memdesc:a3dcd0a546f56884a5e552b5315437e46"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message from a byte buffer.  <a href="#a3dcd0a546f56884a5e552b5315437e46">More...</a><br/></td></tr>
<tr class="separator:a3dcd0a546f56884a5e552b5315437e46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0297a011ab9002ab3fe71156db647da7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a0297a011ab9002ab3fe71156db647da7">message</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>, <a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload)</td></tr>
<tr class="memdesc:a0297a011ab9002ab3fe71156db647da7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message from a byte buffer.  <a href="#a0297a011ab9002ab3fe71156db647da7">More...</a><br/></td></tr>
<tr class="separator:a0297a011ab9002ab3fe71156db647da7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b9be8ddea5e1c31e72468411cdc16c2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a2b9be8ddea5e1c31e72468411cdc16c2">message</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>, const MQTTAsync_message &amp;msg)</td></tr>
<tr class="memdesc:a2b9be8ddea5e1c31e72468411cdc16c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message as a copy of the message structure.  <a href="#a2b9be8ddea5e1c31e72468411cdc16c2">More...</a><br/></td></tr>
<tr class="separator:a2b9be8ddea5e1c31e72468411cdc16c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a36ffb41a2e76db2525654fb1e8b3c40a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a36ffb41a2e76db2525654fb1e8b3c40a">message</a> (const <a class="el" href="classmqtt_1_1message.html">message</a> &amp;other)</td></tr>
<tr class="memdesc:a36ffb41a2e76db2525654fb1e8b3c40a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message as a copy of the other message.  <a href="#a36ffb41a2e76db2525654fb1e8b3c40a">More...</a><br/></td></tr>
<tr class="separator:a36ffb41a2e76db2525654fb1e8b3c40a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97eb09482d0d6432fe996c80ac84a1e0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a97eb09482d0d6432fe996c80ac84a1e0">message</a> (<a class="el" href="classmqtt_1_1message.html">message</a> &amp;&amp;other)</td></tr>
<tr class="memdesc:a97eb09482d0d6432fe996c80ac84a1e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Moves the other message to this one.  <a href="#a97eb09482d0d6432fe996c80ac84a1e0">More...</a><br/></td></tr>
<tr class="separator:a97eb09482d0d6432fe996c80ac84a1e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad66d97679cdd8c1f7b22446801295f51"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad66d97679cdd8c1f7b22446801295f51"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#ad66d97679cdd8c1f7b22446801295f51">~message</a> ()</td></tr>
<tr class="memdesc:ad66d97679cdd8c1f7b22446801295f51"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys a message and frees all associated resources. <br/></td></tr>
<tr class="separator:ad66d97679cdd8c1f7b22446801295f51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae40dd6ffa3596bcef33b81f8a3995f3f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmqtt_1_1message.html">message</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#ae40dd6ffa3596bcef33b81f8a3995f3f">operator=</a> (const <a class="el" href="classmqtt_1_1message.html">message</a> &amp;rhs)</td></tr>
<tr class="memdesc:ae40dd6ffa3596bcef33b81f8a3995f3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copies another message to this one.  <a href="#ae40dd6ffa3596bcef33b81f8a3995f3f">More...</a><br/></td></tr>
<tr class="separator:ae40dd6ffa3596bcef33b81f8a3995f3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab518f92d809b7ee0d74e27b78a8d36fd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmqtt_1_1message.html">message</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#ab518f92d809b7ee0d74e27b78a8d36fd">operator=</a> (<a class="el" href="classmqtt_1_1message.html">message</a> &amp;&amp;rhs)</td></tr>
<tr class="memdesc:ab518f92d809b7ee0d74e27b78a8d36fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Moves another message to this one.  <a href="#ab518f92d809b7ee0d74e27b78a8d36fd">More...</a><br/></td></tr>
<tr class="separator:ab518f92d809b7ee0d74e27b78a8d36fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a46fb7ecf4c687287d459bf6527d3fa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a5a46fb7ecf4c687287d459bf6527d3fa">set_topic</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>)</td></tr>
<tr class="memdesc:a5a46fb7ecf4c687287d459bf6527d3fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the topic string.  <a href="#a5a46fb7ecf4c687287d459bf6527d3fa">More...</a><br/></td></tr>
<tr class="separator:a5a46fb7ecf4c687287d459bf6527d3fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d98dfc2795d3fc101057165cebee888"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a3d98dfc2795d3fc101057165cebee888">get_topic_ref</a> () const </td></tr>
<tr class="memdesc:a3d98dfc2795d3fc101057165cebee888"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the topic reference for the message.  <a href="#a3d98dfc2795d3fc101057165cebee888">More...</a><br/></td></tr>
<tr class="separator:a3d98dfc2795d3fc101057165cebee888"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34e19e65f9653fadb049143d83ed48c7"><td class="memItemLeft" align="right" valign="top">const string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a34e19e65f9653fadb049143d83ed48c7">get_topic</a> () const </td></tr>
<tr class="memdesc:a34e19e65f9653fadb049143d83ed48c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the topic for the message.  <a href="#a34e19e65f9653fadb049143d83ed48c7">More...</a><br/></td></tr>
<tr class="separator:a34e19e65f9653fadb049143d83ed48c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74ab9515b7f84a9023c61a942a2b2459"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a74ab9515b7f84a9023c61a942a2b2459"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a74ab9515b7f84a9023c61a942a2b2459">clear_payload</a> ()</td></tr>
<tr class="memdesc:a74ab9515b7f84a9023c61a942a2b2459"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the payload, resetting it to be empty. <br/></td></tr>
<tr class="separator:a74ab9515b7f84a9023c61a942a2b2459"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90935692f470d1671cff83c6726369f8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a90935692f470d1671cff83c6726369f8"></a>
const <a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a90935692f470d1671cff83c6726369f8">get_payload_ref</a> () const </td></tr>
<tr class="memdesc:a90935692f470d1671cff83c6726369f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the payload reference. <br/></td></tr>
<tr class="separator:a90935692f470d1671cff83c6726369f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13464c7d9c6c92c10e56292cdfa7da48"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a13464c7d9c6c92c10e56292cdfa7da48"></a>
const binary &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a13464c7d9c6c92c10e56292cdfa7da48">get_payload</a> () const </td></tr>
<tr class="memdesc:a13464c7d9c6c92c10e56292cdfa7da48"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the payload. <br/></td></tr>
<tr class="separator:a13464c7d9c6c92c10e56292cdfa7da48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6634b9ae09c114eb4b385e91dd85bf11"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6634b9ae09c114eb4b385e91dd85bf11"></a>
const string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a6634b9ae09c114eb4b385e91dd85bf11">get_payload_str</a> () const </td></tr>
<tr class="memdesc:a6634b9ae09c114eb4b385e91dd85bf11"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the payload as a string. <br/></td></tr>
<tr class="separator:a6634b9ae09c114eb4b385e91dd85bf11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacab31d78f9ac17f962d89f9405c0c38"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#aacab31d78f9ac17f962d89f9405c0c38">get_qos</a> () const </td></tr>
<tr class="memdesc:aacab31d78f9ac17f962d89f9405c0c38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the quality of service for this message.  <a href="#aacab31d78f9ac17f962d89f9405c0c38">More...</a><br/></td></tr>
<tr class="separator:aacab31d78f9ac17f962d89f9405c0c38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad05a411b58f9b7aad271c2dee0c937f8"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#ad05a411b58f9b7aad271c2dee0c937f8">is_duplicate</a> () const </td></tr>
<tr class="memdesc:ad05a411b58f9b7aad271c2dee0c937f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether or not this message might be a duplicate of one which has already been received.  <a href="#ad05a411b58f9b7aad271c2dee0c937f8">More...</a><br/></td></tr>
<tr class="separator:ad05a411b58f9b7aad271c2dee0c937f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa845a148b73a9be79c4e5d09910d36b7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#aa845a148b73a9be79c4e5d09910d36b7">is_retained</a> () const </td></tr>
<tr class="memdesc:aa845a148b73a9be79c4e5d09910d36b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether or not this message should be/was retained by the server.  <a href="#aa845a148b73a9be79c4e5d09910d36b7">More...</a><br/></td></tr>
<tr class="separator:aa845a148b73a9be79c4e5d09910d36b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a627ceed7e384c159ceb7ed347b1b628b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a627ceed7e384c159ceb7ed347b1b628b">set_payload</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload)</td></tr>
<tr class="memdesc:a627ceed7e384c159ceb7ed347b1b628b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the payload of this message to be the specified buffer.  <a href="#a627ceed7e384c159ceb7ed347b1b628b">More...</a><br/></td></tr>
<tr class="separator:a627ceed7e384c159ceb7ed347b1b628b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae784b5150baacfaaca319c0ce84ddcb2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#ae784b5150baacfaaca319c0ce84ddcb2">set_payload</a> (const void *payload, size_t n)</td></tr>
<tr class="memdesc:ae784b5150baacfaaca319c0ce84ddcb2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the payload of this message to be the specified byte array.  <a href="#ae784b5150baacfaaca319c0ce84ddcb2">More...</a><br/></td></tr>
<tr class="separator:ae784b5150baacfaaca319c0ce84ddcb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af666e57c7e68f43e5331f09a843b4262"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#af666e57c7e68f43e5331f09a843b4262">set_qos</a> (int qos)</td></tr>
<tr class="memdesc:af666e57c7e68f43e5331f09a843b4262"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the quality of service for this message.  <a href="#af666e57c7e68f43e5331f09a843b4262">More...</a><br/></td></tr>
<tr class="separator:af666e57c7e68f43e5331f09a843b4262"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51c7f7cfe89ebcc17d1686ec025193d2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a51c7f7cfe89ebcc17d1686ec025193d2">set_retained</a> (bool retained)</td></tr>
<tr class="memdesc:a51c7f7cfe89ebcc17d1686ec025193d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Whether or not the publish message should be retained by the broker.  <a href="#a51c7f7cfe89ebcc17d1686ec025193d2">More...</a><br/></td></tr>
<tr class="separator:a51c7f7cfe89ebcc17d1686ec025193d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39a6b9acac26dac99f20d14a30bc91e2"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a39a6b9acac26dac99f20d14a30bc91e2">to_string</a> () const </td></tr>
<tr class="memdesc:a39a6b9acac26dac99f20d14a30bc91e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a string representation of this messages payload.  <a href="#a39a6b9acac26dac99f20d14a30bc91e2">More...</a><br/></td></tr>
<tr class="separator:a39a6b9acac26dac99f20d14a30bc91e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a3837ff1e6d7ed1227d57fafe1e3618a0"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a3837ff1e6d7ed1227d57fafe1e3618a0">create</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>, const void *payload, size_t len, int qos, bool retained)</td></tr>
<tr class="memdesc:a3837ff1e6d7ed1227d57fafe1e3618a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message with the specified array as a payload, and all other values set to defaults.  <a href="#a3837ff1e6d7ed1227d57fafe1e3618a0">More...</a><br/></td></tr>
<tr class="separator:a3837ff1e6d7ed1227d57fafe1e3618a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b93c447da0fc38e79f2e3cc3a3d5d4a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a3b93c447da0fc38e79f2e3cc3a3d5d4a">create</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>, const void *payload, size_t len)</td></tr>
<tr class="memdesc:a3b93c447da0fc38e79f2e3cc3a3d5d4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message with the specified array as a payload, and all other values set to defaults.  <a href="#a3b93c447da0fc38e79f2e3cc3a3d5d4a">More...</a><br/></td></tr>
<tr class="separator:a3b93c447da0fc38e79f2e3cc3a3d5d4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4475158717c7334cdeee4601f908910"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#aa4475158717c7334cdeee4601f908910">create</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>, <a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload, int qos, bool retained)</td></tr>
<tr class="memdesc:aa4475158717c7334cdeee4601f908910"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message from a byte buffer.  <a href="#aa4475158717c7334cdeee4601f908910">More...</a><br/></td></tr>
<tr class="separator:aa4475158717c7334cdeee4601f908910"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af55e31a3894c91da7586d1181285decd"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#af55e31a3894c91da7586d1181285decd">create</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>, <a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload)</td></tr>
<tr class="memdesc:af55e31a3894c91da7586d1181285decd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message from a byte buffer.  <a href="#af55e31a3894c91da7586d1181285decd">More...</a><br/></td></tr>
<tr class="separator:af55e31a3894c91da7586d1181285decd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff47357d911931406fef240438db891c"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#aff47357d911931406fef240438db891c">create</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="el" href="classmqtt_1_1topic.html">topic</a>, const MQTTAsync_message &amp;msg)</td></tr>
<tr class="memdesc:aff47357d911931406fef240438db891c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a message as a copy of the C message struct.  <a href="#aff47357d911931406fef240438db891c">More...</a><br/></td></tr>
<tr class="separator:aff47357d911931406fef240438db891c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5da9f7a3c9c437069e32f05a933a62aa"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a5da9f7a3c9c437069e32f05a933a62aa">validate_qos</a> (int qos)</td></tr>
<tr class="memdesc:a5da9f7a3c9c437069e32f05a933a62aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines if the QOS value is a valid one.  <a href="#a5da9f7a3c9c437069e32f05a933a62aa">More...</a><br/></td></tr>
<tr class="separator:a5da9f7a3c9c437069e32f05a933a62aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a9689553c0840b987f5aa064b3692e09c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9689553c0840b987f5aa064b3692e09c"></a>
static constexpr int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">DFLT_QOS</a> = 0</td></tr>
<tr class="memdesc:a9689553c0840b987f5aa064b3692e09c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The default QoS for a message. <br/></td></tr>
<tr class="separator:a9689553c0840b987f5aa064b3692e09c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4130d0db580fb11ee4a476712f000d48"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4130d0db580fb11ee4a476712f000d48"></a>
static constexpr bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">DFLT_RETAINED</a> = false</td></tr>
<tr class="memdesc:a4130d0db580fb11ee4a476712f000d48"><td class="mdescLeft">&#160;</td><td class="mdescRight">The default retained flag. <br/></td></tr>
<tr class="separator:a4130d0db580fb11ee4a476712f000d48"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:ac39954340d8b15edaa883af1bcfcf7ae"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1message.html#ac39954340d8b15edaa883af1bcfcf7ae">async_client</a></td></tr>
<tr class="memdesc:ac39954340d8b15edaa883af1bcfcf7ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">The client has special access.  <a href="#ac39954340d8b15edaa883af1bcfcf7ae">More...</a><br/></td></tr>
<tr class="separator:ac39954340d8b15edaa883af1bcfcf7ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab210e4c30b4826424d7f2ae5e666eb1a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab210e4c30b4826424d7f2ae5e666eb1a"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>message_test</b></td></tr>
<tr class="separator:ab210e4c30b4826424d7f2ae5e666eb1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An MQTT message holds everything required for an MQTT PUBLISH message. </p>
<p>This holds the binary message payload, topic string, and all the additional meta-data for an MQTT message.</p>
<p>The topic and payload buffers are kept as references to const data, so they can be reassigned as needed, but the buffers can not be updated in-place. Normally they would be created externally then copied or moved into the message. The library to transport the messages never touchec the payloads or topics.</p>
<p>This also means that message objects are farily cheap to copy, since they don't copy the payloads. They simply copy the reference to the buffers. It is safe to pass these buffer references across threads since all references promise not to update the contents of the buffer. </p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a class="anchor" id="a99c3bfaaac300457e9678b5d1be30a43"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classmqtt_1_1message.html#a99c3bfaaac300457e9678b5d1be30a43">mqtt::message::const_ptr_t</a> =  std::shared_ptr&lt;const <a class="el" href="classmqtt_1_1message.html">message</a>&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Smart/shared pointer to this class. </p>

</div>
</div>
<a class="anchor" id="af207327d7802ed7133640d3c18921017"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">mqtt::message::ptr_t</a> =  std::shared_ptr&lt;<a class="el" href="classmqtt_1_1message.html">message</a>&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Smart/shared pointer to this class. </p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="abd8379776588fb77bbdc967c74e13cb3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mqtt::message::message </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>retained</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs a message with the specified array as a payload, and all other values set to defaults. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The message topic </td></tr>
    <tr><td class="paramname">payload</td><td>the bytes to use as the message payload </td></tr>
    <tr><td class="paramname">len</td><td>the number of bytes in the payload </td></tr>
    <tr><td class="paramname">qos</td><td>The quality of service for the message. </td></tr>
    <tr><td class="paramname">retained</td><td>Whether the message should be retained by the broker. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2faf94bc3aaf3d8795d2be0933df7ce4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">mqtt::message::message </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a message with the specified array as a payload, and all other values set to defaults. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The message topic </td></tr>
    <tr><td class="paramname">payload</td><td>the bytes to use as the message payload </td></tr>
    <tr><td class="paramname">len</td><td>the number of bytes in the payload </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a3dcd0a546f56884a5e552b5315437e46"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mqtt::message::message </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a>&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>retained</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs a message from a byte buffer. </p>
<p>Note that the payload accepts copy or move semantics. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The message topic </td></tr>
    <tr><td class="paramname">payload</td><td>A byte buffer to use as the message payload. </td></tr>
    <tr><td class="paramname">qos</td><td>The quality of service for the message. </td></tr>
    <tr><td class="paramname">retained</td><td>Whether the message should be retained by the broker. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a0297a011ab9002ab3fe71156db647da7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">mqtt::message::message </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a>&#160;</td>
          <td class="paramname"><em>payload</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a message from a byte buffer. </p>
<p>Note that the payload accepts copy or move semantics. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The message topic </td></tr>
    <tr><td class="paramname">payload</td><td>A byte buffer to use as the message payload. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2b9be8ddea5e1c31e72468411cdc16c2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mqtt::message::message </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const MQTTAsync_message &amp;&#160;</td>
          <td class="paramname"><em>msg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs a message as a copy of the message structure. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The message topic </td></tr>
    <tr><td class="paramname">msg</td><td>A "C" MQTTAsync_message structure. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a36ffb41a2e76db2525654fb1e8b3c40a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mqtt::message::message </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classmqtt_1_1message.html">message</a> &amp;&#160;</td>
          <td class="paramname"><em>other</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs a message as a copy of the other message. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">other</td><td>The message to copy into this one. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a97eb09482d0d6432fe996c80ac84a1e0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mqtt::message::message </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1message.html">message</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>other</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Moves the other message to this one. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">other</td><td>The message to move into this one. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a3837ff1e6d7ed1227d57fafe1e3618a0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> mqtt::message::create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>retained</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a message with the specified array as a payload, and all other values set to defaults. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The message topic </td></tr>
    <tr><td class="paramname">payload</td><td>the bytes to use as the message payload </td></tr>
    <tr><td class="paramname">len</td><td>the number of bytes in the payload </td></tr>
    <tr><td class="paramname">qos</td><td>The quality of service for the message. </td></tr>
    <tr><td class="paramname">retained</td><td>Whether the message should be retained by the broker. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a3b93c447da0fc38e79f2e3cc3a3d5d4a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> mqtt::message::create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a message with the specified array as a payload, and all other values set to defaults. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The message topic </td></tr>
    <tr><td class="paramname">payload</td><td>the bytes to use as the message payload </td></tr>
    <tr><td class="paramname">len</td><td>the number of bytes in the payload </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa4475158717c7334cdeee4601f908910"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> mqtt::message::create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a>&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>retained</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a message from a byte buffer. </p>
<p>Note that the payload accepts copy or move semantics. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The message topic </td></tr>
    <tr><td class="paramname">payload</td><td>A byte buffer to use as the message payload. </td></tr>
    <tr><td class="paramname">qos</td><td>The quality of service for the message. </td></tr>
    <tr><td class="paramname">retained</td><td>Whether the message should be retained by the broker. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af55e31a3894c91da7586d1181285decd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> mqtt::message::create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a>&#160;</td>
          <td class="paramname"><em>payload</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a message from a byte buffer. </p>
<p>Note that the payload accepts copy or move semantics. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The message topic </td></tr>
    <tr><td class="paramname">payload</td><td>A byte buffer to use as the message payload. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aff47357d911931406fef240438db891c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> mqtt::message::create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const MQTTAsync_message &amp;&#160;</td>
          <td class="paramname"><em>msg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a message as a copy of the C message struct. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The message topic </td></tr>
    <tr><td class="paramname">msg</td><td>A "C" MQTTAsync_message structure. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aacab31d78f9ac17f962d89f9405c0c38"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int mqtt::message::get_qos </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the quality of service for this message. </p>
<dl class="section return"><dt>Returns</dt><dd>The quality of service for this message. </dd></dl>

</div>
</div>
<a class="anchor" id="a34e19e65f9653fadb049143d83ed48c7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const string&amp; mqtt::message::get_topic </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the topic for the message. </p>
<dl class="section return"><dt>Returns</dt><dd>The topic string for the message. </dd></dl>

</div>
</div>
<a class="anchor" id="a3d98dfc2795d3fc101057165cebee888"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&amp; mqtt::message::get_topic_ref </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the topic reference for the message. </p>
<dl class="section return"><dt>Returns</dt><dd>The topic reference for the message. </dd></dl>

</div>
</div>
<a class="anchor" id="ad05a411b58f9b7aad271c2dee0c937f8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool mqtt::message::is_duplicate </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns whether or not this message might be a duplicate of one which has already been received. </p>
<dl class="section return"><dt>Returns</dt><dd>true this message might be a duplicate of one which has already been received, false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="aa845a148b73a9be79c4e5d09910d36b7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool mqtt::message::is_retained </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns whether or not this message should be/was retained by the server. </p>
<dl class="section return"><dt>Returns</dt><dd>true if this message should be/was retained by the server, false otherwise. </dd></dl>

</div>
</div>
<a class="anchor" id="ae40dd6ffa3596bcef33b81f8a3995f3f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1message.html">message</a>&amp; mqtt::message::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classmqtt_1_1message.html">message</a> &amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Copies another message to this one. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rhs</td><td>The other message. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A reference to this message. </dd></dl>

</div>
</div>
<a class="anchor" id="ab518f92d809b7ee0d74e27b78a8d36fd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1message.html">message</a>&amp; mqtt::message::operator= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1message.html">message</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Moves another message to this one. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rhs</td><td>The other message. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A reference to this message. </dd></dl>

</div>
</div>
<a class="anchor" id="a627ceed7e384c159ceb7ed347b1b628b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mqtt::message::set_payload </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a>&#160;</td>
          <td class="paramname"><em>payload</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the payload of this message to be the specified buffer. </p>
<p>Note that this accepts copy or move operations: set_payload(buf); set_payload(std::move(buf)); </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>A buffer to use as the message payload. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae784b5150baacfaaca319c0ce84ddcb2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void mqtt::message::set_payload </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets the payload of this message to be the specified byte array. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>the bytes to use as the message payload </td></tr>
    <tr><td class="paramname">n</td><td>the number of bytes in the payload </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af666e57c7e68f43e5331f09a843b4262"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void mqtt::message::set_qos </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets the quality of service for this message. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qos</td><td>The integer Quality of Service for the message </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a51c7f7cfe89ebcc17d1686ec025193d2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void mqtt::message::set_retained </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>retained</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Whether or not the publish message should be retained by the broker. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">retained</td><td><em>true</em> if the message should be retained by the broker, <em>false</em> if not. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5a46fb7ecf4c687287d459bf6527d3fa"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void mqtt::message::set_topic </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">string_ref</a>&#160;</td>
          <td class="paramname"><em>topic</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets the topic string. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topic</td><td>The topic on which the message is published. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a39a6b9acac26dac99f20d14a30bc91e2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">string mqtt::message::to_string </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a string representation of this messages payload. </p>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a5da9f7a3c9c437069e32f05a933a62aa"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void mqtt::message::validate_qos </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determines if the QOS value is a valid one. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qos</td><td>The QOS value. </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::invalid_argument</td><td>If the qos value is invalid. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a class="anchor" id="ac39954340d8b15edaa883af1bcfcf7ae"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="classmqtt_1_1async__client.html">async_client</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The client has special access. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/mqtt/<a class="el" href="message_8h_source.html">message.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>mqtt</b></li><li class="navelem"><a class="el" href="classmqtt_1_1message.html">message</a></li>
    <li class="footer">Generated on Sun Jul 23 2017 10:24:30 for Paho C++ by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
